import { AIPropertyDescriptor, IField } from "../AIProperty";
import { Field } from "./Field";

export class CustomButtonsField extends Field implements IField {
    create(o: AIPropertyDescriptor, data: any) {
        let p = this._create(o, "Buttons",data);
        this.data = data;
        let bt1 = p.getChild("btn1");
        //let bt2 = p.getChild('btn2');

        if(o.onClick){
            bt1.on('click', o.onClick, this);
        }
        //bt2.on('click', this._clickHandle, this);
        return p;
    }
    // private _clickHandle(e: gui.Event) {
    //     console.log((e.target as any).name);
    //     console.log(this.data);
    // }
}